#include "StdAfx.h"
#include "Register.h"

CRegister::CRegister(void)
{
	m_pClient=NULL;
	m_pRegister=NULL;
}

CRegister::~CRegister(void)
{
	if(m_pClient)
		delete m_pClient;
}

bool CRegister::Registe( TTChatGlobal::LPTTRegistionInfo pRegInfo )
{
	m_pRegister=pRegInfo;
	JID jid(pRegInfo->username);
	m_pClient=new CTTRegisterClient(jid,pRegInfo->password);
	m_pClient->SetNotifyWnd(m_hNoticeWnd);
	m_pClient->SetRegisterInfo(pRegInfo);
	m_pClient->disableRoster();
	m_pClient->connect();

	delete(m_pClient);
	m_pClient=NULL;
	return true;
}

void CRegister::SetNoticeWnd( HWND hNoticeWnd )
{
	m_hNoticeWnd=hNoticeWnd;
}
